<template>
  <div class="">
    <div>
      <input v-model.lazy="taskItem" type="text" />
      <button @click="handleAdd()">添加</button>
    </div>
    <div class="task-items">
      <div class="task-item" v-for="(task, index) in taskStore.tasks" :key="index">
        <span>{{ task }}</span>
        <button @click="taskStore.handleDelete(index)">删除</button>
      </div>
    </div>
    <el-button>123</el-button>
    <div>
      {{ title }}
    </div>
  </div>
</template>

<script setup lang="ts">
import {ref} from 'vue'
import {useTaskStore} from '@/store'
import request from '@/axios'

const props = defineProps({
  title: {
    type: String,
    default: '325'
  }
})

console.log(props)

const taskItem = ref<string>('')

const taskStore = useTaskStore()

const handleAdd = () => {
  taskStore.handleAdd(taskItem.value)
  taskItem.value = ''
}

request.get('./1.txt').then((result) => {
  console.log(result)
})

</script>

<style lang="less" scoped>

</style>